package oop_homework_2;

import day08.set;

public class Bankaccount {
	private int account;//账号
	private String name ;//姓名
	private String address;//地址
	private double balance;//余额
	final double minBalance = 1;//最小余额
	private double deal;//交易额
	/*
	 * 存款方法
	 * */
	public void deposit(double deal) {
		balance +=deal;
		System.out.println("原有余额："+(balance - deal)+"\t"+"今日存款数额："+deal+"\t"+"最终存款余额："+balance);
	}
	/*
	 * 取款方法
	 * */
	public void withdraw(double deal) {
		if (balance-deal<minBalance) {
			System.out.println("无法完成操作，余额不足！");
			return;
		}
		balance -= deal;
		System.out.println("原有余额："+(balance - deal)+"\t"+"今日存款数额：-"+deal+"\t"+"最终存款余额："+balance);
	}
	/*
	 * 查询方法
	 * */
	public void query(){			
			System.out.println("账号:" + account + ", 姓名：" + name + ", 地址：" + address + ", 余额：" + balance
					+ ", 最小余额：" + minBalance +  "]");
		
	}
	
	
	public Bankaccount(int account, String name, String address, double balance) {
		super();
		this.account = account;
		this.name = name;
		this.address = address;
		this.balance = balance;
	}
	@Override
	public String toString() {
		return "Bankaccount [account=" + account + ", name=" + name + ", address=" + address + ", balance=" + balance
				+ ", minBalance=" + minBalance + ", deal=" + deal + "]";
	}
	public int getAccount() {
		return account;
	}
	public void setAccount(int account) {
		this.account = account;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getAddress() {
		return address;
	}
	public void setAddress(String address) {
		this.address = address;
	}
	public double getBalance() {
		return balance;
	}
	public void setBalance(double balance) {
		this.balance = balance;
	}
	public double getMinBalance() {
		return minBalance;
	}
	public double getDeal() {
		return deal;
	}
	public void setDeal(double deal) {
		this.deal = deal;
	}
	
	
}
